package com.shop.api.feign;

import com.shop.Result.LdbzResult;
import com.shop.pojo.LdbzItem;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "shop-service-admin")
public interface AdminItemFeign {

    //修改页面跳转
    @RequestMapping(value = "/admin/item/service/editItem/{id}",method = RequestMethod.GET)
    LdbzResult editItem(@RequestParam("id")long id);

    //获取商品信息
    @RequestMapping(value = "/admin/item/service/getItemList",method = RequestMethod.GET)
    LdbzResult getItemList(@RequestParam("entity") LdbzItem entity);

    //分页获取产品
    @RequestMapping(value = "/admin/item/service/getItemPage",method = RequestMethod.GET)
    LdbzResult getItemPage(@RequestParam("entity")LdbzItem entity,@RequestParam("page")int page,@RequestParam("limit")int limit);

    //删除商品
    @RequestMapping(value = "/admin/item/service/deleteByKey/{id}",method = RequestMethod.GET)
    LdbzResult deleteByKey(@RequestParam("id")String id);

    //新增商品
    @RequestMapping(value = "/admin/item/service/insertByEntity",method = RequestMethod.GET)
    LdbzResult insertByEntity(@RequestParam("entity")LdbzItem entity);

    //修改商品
    @RequestMapping(value = "/admin/item/service/updateByKey",method = RequestMethod.GET)
    LdbzResult updateByKey(@RequestParam("entity")LdbzItem entity);

    //商品同步到es
    @RequestMapping(value = "/admin/item/service/syncItemToESByCode/{code}",method = RequestMethod.GET)
    LdbzResult syncItemToESByCode(@RequestParam("code")long code);

    @RequestMapping(value = "/admin/item/service/countAdminUser",method = RequestMethod.GET)
    LdbzResult countAdminUser(@RequestParam("entity")LdbzItem entity);
}
